#pragma once

#include "FastMutex.h"

CONST int g_MaxMonitoredDevices = 32;

class MonitoredDevice
{
public:
	UNICODE_STRING m_DeviceName;
	PDEVICE_OBJECT m_DeviceObject;
	PDEVICE_OBJECT m_LowerDeviceObject;
};

class DeviceExtension
{
public:
	PDEVICE_OBJECT m_LowerDeviceObject;
};

class DevMonManager
{
public:
	VOID Init(PDRIVER_OBJECT DriverObject);
	NTSTATUS AddDevice(PCWSTR Name);
	int FindDevice(PCWSTR Name) CONST;
	BOOLEAN RemoveDevice(PCWSTR Name);
	VOID RemoveAllDevices();

public:
	PDEVICE_OBJECT CDO;

private:
	BOOLEAN RemoveDevice(int Index);

private:
	MonitoredDevice m_Devives[g_MaxMonitoredDevices];
	int             m_MonitoredDeviceCount;
	FastMutex       m_Lock;
	PDRIVER_OBJECT  m_DriverObject;
};